package wonder.com.chinaerweima.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by Administrator on 2016/6/22.
 */
public abstract class BaseFregment extends Fragment {
    private int LayoutResId;
    private View LayoutView;
   protected abstract void findView();
   protected abstract void initView();

    public BaseFregment(int layoutResId) {
        LayoutResId = layoutResId;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
       LayoutView= inflater.inflate(LayoutResId,null);
        return LayoutView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        findView();
        initView();
    }
    public View findViewById(int resId){
        return LayoutView.findViewById(resId);
    }
}
